package com.longcai.controller.fuyoupay;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONObject;
import com.longcai.bean.ApiResult;
import com.longcai.entity.payment.fuyou.request.ClyjFuyouRefund;
import com.longcai.enums.ResultEnum;
import com.longcai.service.fuyoupay.ClyjFuyouRefundService;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author LWK
 * @since 2019-04-16
 */
@Controller
@RequestMapping("/clyjFuyouRefund")
public class ClyjFuyouRefundController {
	@Autowired  
	private ClyjFuyouRefundService clyjFuyouRefundService;
	@RequestMapping("/refundSave")
	@ResponseBody
	public ApiResult<?> refund (@RequestBody JSONObject params){
		ClyjFuyouRefund cfr=clyjFuyouRefundService.checkout(params);
		if (cfr!=null) {
			boolean b=clyjFuyouRefundService.insert(cfr);
			if(b){
				return ApiResult.success("退款成功");
			}
		}
		return ApiResult.fail("退款失败");
	}
}

